package com.io.controller;

import com.io.service.FileServer;
import com.io.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

@RestController
@RequestMapping("/api")
@Api(tags = {"文件管理2"})
public class FileController {

    @Autowired
    private FileServer fileServer;



    @PostMapping("/upload")
    @ApiOperation("文件上传")
    public R  upload(MultipartFile filename){
     fileServer.upload(filename);
        return R.ok();
    }


}
